package com.yuanluludev.app.activity

import android.os.Bundle
import com.gyf.immersionbar.ImmersionBar
import com.yuanluludev.app.R
import com.yuanluludev.app.navigationview.NavigationActivity
import com.yuanluludev.lib_base.base.BaseActivity
import com.yuanluludev.lib_utils.util.LogUtils
import io.reactivex.rxjava3.core.Observable
import io.reactivex.rxjava3.disposables.Disposable
import java.util.concurrent.TimeUnit


/**
 *  闪屏页
 */
class SplashActivity : BaseActivity() {

    private var timerSubscribe: Disposable? = null

    override fun initEvents(savedInstanceState: Bundle?) {

        if (ImmersionBar.isSupportStatusBarDarkFont()) {
            LogUtils.e("是否支持---- 支持")
        } else {
            LogUtils.e("是否支持---- 不支持")
        }

        timerSubscribe = Observable.timer(2000, TimeUnit.MILLISECONDS).subscribe {
            startActivity(NavigationActivity::class.java)
            finish()
        }

    }

    override fun isStatusBarEnabled() = true

    override fun getLayoutResId() = R.layout.activity_splash

}